from marshmallow import fields
from src.baseapp.requestVerify.BaseRequestVerify import BaseSchema


class PlanListBodySchema(BaseSchema):
    plan_id = fields.Integer(required=False)
    plan_name = fields.Str(required=False)
    project_id = fields.List(cls_or_instance=fields.Integer, required=False)
    plan_status = fields.List(cls_or_instance=fields.Integer, required=False)
    create_user_id = fields.Integer(required=False)
    create_time = fields.List(cls_or_instance=fields.DateTime, required=False, max_length=2)
    update_time = fields.List(cls_or_instance=fields.DateTime, required=False, max_length=2)
    is_delete = fields.Integer(required=False)


class PlanInfoBodySchema(BaseSchema):
    plan_id = fields.Integer(required=True)


class PlanCreateBodySchema(BaseSchema):
    plan_name = fields.Str(required=True)
    plan_description = fields.Str(required=False)
    project_id = fields.Integer(required=True)
    create_user_id = fields.Integer(required=True)
    plan_pre_start_time = fields.DateTime(required=False)
    plan_pre_end_time = fields.DateTime(required=False)
    plan_actual_start_time = fields.DateTime(required=False)
    plan_actual_end_time = fields.DateTime(required=False)


class PlanUpdateBodySchema(BaseSchema):
    plan_ids = fields.List(cls_or_instance=fields.Integer, required=True)
    plan_name = fields.Str(required=False)
    plan_description = fields.Str(required=False)
    project_id = fields.Integer(required=False)
    plan_pre_start_time = fields.DateTime(required=False)
    plan_pre_end_time = fields.DateTime(required=False)
    plan_actual_start_time = fields.DateTime(required=False)
    plan_actual_end_time = fields.DateTime(required=False)



class PlanCaseBodySchema(BaseSchema):
    plan_id = fields.Integer(required=True)
    case_ids = fields.List(cls_or_instance=fields.Integer, required=True)


class PlanCaseStatusBodySchema(PlanCaseBodySchema):
    status = fields.Integer(required=True)
    remark = fields.Str(required=False)
    


